import { request } from "@/utils/request"
const prefix = '/maintenancer'

/**
 * 获取维修管理员
 * @returns 
 */
export const getMaintenancerRequest = () => {
	return request.get(`${prefix}/getMaintenancer`)
}

export interface maintenancerParams {
	username: string,
	password: string,
	phone: string,
	name: string
}
/**
 * 添加维修员
 * @param params 
 * @returns 
 */
export const addMaintenancerRequest = (params: maintenancerParams) => {
	return request.post(`${prefix}/addMaintenancer`, params)
}

/**
 * 删除维修员
 * @param params 
 * @returns 
 */
export const deleteMaintenancerRequest = (params: number) => {
	return request.delete(`${prefix}/deleteMaintenancer/${params}`)
}

/**
 * 修改维修员信息
 * @param params 
 * @returns 
 */
export const reviseMaintenancerRequest = (params: maintenancerParams) => {
	return request.put(`${prefix}/reviseMaintenancer`, params)
}

/**
 * 获取当前维修员的维修列表
 * @returns 
 */
export const getListRequest = () => {
	return request.get(`${prefix}/getList`)
}

interface maintenanceParams {
	id: number,
	status: number,
	cost: number
}
/**
 * 修改维修信息
 * @param params 
 * @returns 
 */
export const reviseMaintenanceRequest = (params: maintenanceParams) => {
	return request.put(`${prefix}/reviseMaintenance`, params)
}